package com.itheima.apitest.datetest3;


import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

//throws  throw 练习
public class ExceptionDemo01 {
    public static void main(String[] args) throws ParseException {
        System.out.println("开始");
        //method();
        method2();
        System.out.println("结束");
    }

    private static void method2() throws ParseException {
        String s = "2020-11-11";
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date d = simpleDateFormat.parse(s);
        System.out.println(d);
    }

    public static void method() throws ArrayIndexOutOfBoundsException{
        int[] arr = {1,2,3};
        System.out.println(arr[3]);
    }
}
